package com.example.localexceptionhandler.controller;

import com.example.localexceptionhandler.enums.CommonExceptionEnum;
import com.example.localexceptionhandler.enums.OneExceptionEnum;
import com.example.localexceptionhandler.enums.TwoExceptionEnum;
import com.example.localexceptionhandler.exception.XJRuntimeException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version 1.0
 * @program: localexceptionhandler
 * @packageName: com.example.localexceptionhandler.controller
 * @className HelloController
 * @description: TODO
 * @author: xj
 * @create: 2021-01-18 11:17:35
 **/
@RestController
public class HelloController {

    @RequestMapping(value = "hello",method = RequestMethod.GET)
    public String hello(){
//        throw new XJRuntimeException(OneExceptionEnum.XJ_ONE_EXCP);
//        throw new XJRuntimeException(TwoExceptionEnum.XJ_TWO_EXCP);
        throw new XJRuntimeException(CommonExceptionEnum.COMMON_EXCPETION);
//        return "hello";
    }
}
